<?php
/**
 * Yii view form
 *
 * @author luubk
 * @since Jan 14, 2013 - 11:14:48 AM
 */
$auth = Yii::app()->authManager;
$authitem = $auth->getAuthItem($this->model->name);
if ($authitem == NULL)
{

    class NewAuth
    {

        public $nameb = 'new';
        public $description = 'new';
        public $data;
        public $rule;

        public function hasChild($param)
        {
            return FALSE;
        }

    }

    $authitem = new NewAuth;
}

$type = isset($_GET['type']) ? $_GET['type'] : '';
?>
<h3><?php echo ucfirst($this->model->description) ?></h3>
<?php
$form = $this->beginWidget('CActiveForm', array(
    'enableClientValidation' => true,
        ));
?>
<div class="row-fluid">
    <!--Pagination Start-->
    <div class="grid">
        <div class="grid-title">
            <div class="pull-left"><?php echo $this->pageTitle ?></div>
            <div class="pull-right"></div>
            <div class="clear"></div>
        </div>

        <div class="grid-content">
            <div class="formRow">
                <?php echo $form->labelEx($this->model, 'name') ?>
                <div class="formRight">
                    <?php echo $form->textField($this->model, "name"); ?>
                    <?php echo $form->error($this->model, "name"); ?>
                    <div class="clear"></div>
                </div>
            </div>
            <div class="formRow">
                <?php echo $form->labelEx($this->model, 'description') ?>
                <div class="formRight">
                    <?php echo $form->textField($this->model, "description"); ?>
                    <?php echo $form->error($this->model, "description"); ?>
                    <div class="clear"></div>
                </div>
            </div>
<!--            <div class="formRow">
                <?php // echo $form->labelEx($this->model, 'bizrule') ?>
                <div class="formRight">
                    <?php // echo $form->dropDownList($this->model, "bizrule", AuthItem::bizRuleArray(), array('class' => 'span5')); ?>
                    <?php // echo $form->error($this->model, "bizrule"); ?>
                    <div class="clear"></div>
                </div>
            </div>            -->
            <div class="formRow">
                <div class="formRight">
                    <input type="submit" class="btn btn-primary" value="<?php echo Yii::t('form', 'Save') ?>"/>
                    <input type="reset" class="btn" value="<?php echo Yii::t('form', 'Reset') ?>"/>
                </div>
            </div>
            <div class="clear"></div>

        </div>    
    </div>    
</div>
<?php $this->endWidget(); ?>